package com.huilan.hgt.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.huilan.hgt.base.BaseModel;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * <p>
 * 用户表
 * </p>
 *
 * @author ghy
 * @since 2018-11-09
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("T_USER")
public class User extends BaseModel<User> {

    private static final long serialVersionUID = 1L;

    /**
     * 用户ID
     */
    @TableId(value = "USER_ID", type = IdType.AUTO)
    private Integer userId;

    /**
     * 用户名
     */
    @TableField("USERNAME")
    private String username;

    /**
     * 姓氏
     */
    @TableField("REALNAME")
    private String realname;

    /**
     * 邮件地址
     */
    @TableField("EMAIL_ADDRESS")
    private String emailAddress;

    /**
     * 密码
     */
    @TableField("PASSWORD")
    private String password;

    /**
     * PIN码
     */
    @TableField("PIN")
    private Integer pin;

    /**
     * PIN是否启用（0否，1是）
     */
    @TableField("PIN_STATE")
    private Integer pinState;

    /**
     * 备注
     */
    @TableField("REMARK")
    private String remark;

    /**
     * 角色名称
     */
    @TableField(exist = false)
    private String roleName;



    public static final String USER_ID = "USER_ID";

    public static final String USERNAME = "USERNAME";

    public static final String FIRST_NAME = "FIRST_NAME";

    public static final String LAST_NAME = "LAST_NAME";

    public static final String EMAIL_ADDRESS = "EMAIL_ADDRESS";

    public static final String PASSWORD = "PASSWORD";

    public static final String PIN = "PIN";

    public static final String PIN_STATE = "PIN_STATE";

    public static final Integer PIN_USEING = 1;

    @Override
    protected Serializable pkVal() {
        return this.userId;
    }

}
